<?php 
$connectioncheckhinh = mysql_connect("1.234.20.151", "cam", "5678") ;
mysql_select_db("elicam", $connectioncheckhinh);
mysql_query("set names 'utf8'",$connectioncheckhinh);
include 'processlistclass.php';
/*if(!isset($_SESSION['prolist'])){
	$_SESSION['prolist']= array();
}*/
if($connectioncheckhinh){
	$sql="show PROCESSLIST";
	$mkq=mysql_query($sql,$connectioncheckhinh);
	$sl=mysql_num_rows($mkq);
	if($sl>0){
		$_SESSION['prolist']= array();
		$i=0;
		while($row = mysql_fetch_array($mkq)){
			$pl= new processlist();
			$pl->newprocesslist(chop($row['Id']), chop($row['User']), chop($row['Host']), chop($row['db']), $row['Command'], $row['Time'], $row['Sate'], $row['Info']);
			$_SESSION['prolist'][$i++]=$pl;
		}
	}
	$sl=count($_SESSION['prolist']);
	if($sl>0){
		?>
		<table>
			<tr>
				<td>TT</td>
				<td>ID</td>
				<td>User</td>
				<td>Host</td>
				<td>DB</td>
				<td>Command</td>
				<td>Time</td>
				<td>Sate</td>
				<td>Info</td>
			</tr>
		<?php 
		for($i=0;$i<$sl;$i++){
			$vpl= unserialize (serialize ($_SESSION['prolist'][$i]));
			?>
			<tr>
				<td><?=($i+1)?></td>
				<td><?=$vpl->id?></td>
				<td><?=$vpl->user?></td>
				<td><?=$vpl->host?></td>
				<td><?=$vpl->db?></td>
				<td><?=$vpl->command?></td>
				<td><?=$vpl->time?></td>
				<td><?=$vpl->sate?></td>
				<td><?=$vpl->info?></td>
			</tr>
			<?php 
		}
		?>
		</table>
		<?php 
	}
	mysql_close($connectioncheckhinh);
}else{
	echo "connect die";
}
?>